import { PACKAGES } from "./utils";


export const SCHEMA = {

}
declare const Intent: any;
const flags: any = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK;


/**
 * 通讯录朋友
 */
export function kwaiContacts() {
    const uri = `kwai://contacts`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}

/**
 * 推荐朋友
 */
export function kwaiExplorefriend() {
    const uri = `kwai://explorefriend`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}
/**
 * 朋友
 */
export function kwaiRecommendfriend() {
    const uri = `kwai://recommendfriend`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}


/**
 * 谁提醒我更新
 */
export function kwaiUsersMissu() {
    const uri = `kwai://users/missu`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}


/**
 * 新增粉丝
 */
export function kwaiFans() {
    const uri = `kwai://fans`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}


export function kwaiUrl(url: string) {
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: url
    });
    context.startActivity(intent);
}


export function kwaiHomeCurrentorhome(pkg: string = PACKAGES.KUAI_SHOU) {
    let uri = `kwai://home/currentorhome`;
    if (pkg === PACKAGES.KUAI_SHOU_Nebula) {
        uri = `ksnebula://home/currentorhome`
    }
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}

// liveaggregatesquare

export function kwaiLiveaggregatesquare(pkg: string = PACKAGES.KUAI_SHOU) {
    let uri = `kwai://liveaggregatesquare?growth_channel_id=DESKTOP__WIDGET__FOLLOW__LIVE`;
    if (pkg === PACKAGES.KUAI_SHOU_Nebula) {
        uri = `ksnebula://liveaggregatesquare?growth_channel_id=DESKTOP__WIDGET__FOLLOW__LIVE`
    }
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}
/**
 * 黑名单
 */
export function kwaiBlacklist() {
    const uri = `kwai://blacklist`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}


/**
 * 关注粉丝列表设置
 */
export function kwaiFollowFansListSettings() {
    const uri = `kwai://followFansListSettings`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri
    });
    context.startActivity(intent);
}

/**
 * 设置
 */
export function kwaiSettings() {
    const uri = `kwai://settings`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri
    });
    context.startActivity(intent);
}

/**
 * 快手桌面组件
 */
export function kwaiSettingWidget() {
    const uri = `kwai://setting/widget`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri
    });
    context.startActivity(intent);
}
/**
 * 关注的人
 */
export function kwaiGrowthWidgetFollowing() {
    const uri = `kwai://growth/widget/following`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri
    });
    context.startActivity(intent);
}

/**
 * 卸载
 **/
export function kwaiRetain() {
    const uri = `kwai://retain`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}

/**
 * 关注的人
 */
export function kwaiMerchanthome() {
    const uri = `kwai://merchanthome`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}


export function kwaiHomePage(pkg: string) {
    let uri = `kwai://home`;
    if (pkg === PACKAGES.KUAI_SHOU_Nebula) {
        uri = `ksnebula://home`
    }
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}
/**
 * 更多关注
 * @param pkg 
 */
export function kwaiLiveMyFollow(pkg: string = PACKAGES.KUAI_SHOU) {
    let uri = `kwai://livemyfollow`;
    if (pkg === PACKAGES.KUAI_SHOU_Nebula) {
        uri = `ksnebula://livemyfollow`
    }
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}


/**
 * 验证不生效
 */

export function kwaiUsers() {
    const uri = `ks://users`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}


export function kwaiFollowers() {
    const uri = `kwai://followers`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}


export function kwaiGuestAggregate() {
    const uri = `kwai://guest/aggregate`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}


export function kwaiCleanCacheMiddle() {
    const uri = `kwai://cleancachemiddle`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}



export function kwaiLoginRouter() {
    const uri = `kwai://loginrouter`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}



export function kwaiCleaner() {
    const uri = `kwai://loginrouter`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}


export function kwaiMerchantPurchasepanel() {
    const uri = `kwai://merchant/purchasepanel`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri,
        flags
    });
    context.startActivity(intent);
}



export function kwaiProfilePage(id: string) {
    const uri = `kwai://profile/${id}`;
    const intent = app.intent({
        action: "android.intent.action.VIEW",
        data: uri
    });
    context.startActivity(intent);
}